{%- macro voila_setup(base_url, nbextensions) -%}
<script>
  requirejs.config({ baseUrl: '{{base_url}}voila/', waitSeconds: 30});
  window.voila_js_url = "{{ static_url('voila.js')}}";
  requirejs(["{{ static_url('main.js') }}"]);

  // Loading classic notebook extensions.
  {% for ext in nbextensions -%}
  requirejs(["{{base_url}}voila/nbextensions/{{ ext }}.js"],
    function() {
      console.log("Loaded classic notebook extension \"{{ ext }}\".");
    },
    function() {
      console.error("Failed to load classic notebook extension \"{{ ext }}\".");
    }
  );
  {% endfor %}
</script>
{%- endmacro %}
